<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><title>Waline 评论系统部署日志 | CC的部落格</title><meta name="author" content="CC康纳百川"><meta name="copyright" content="CC康纳百川"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="ffffff"><article data-clarity-region="article"></article><meta name="description" content="Waline 评论系统部署日志，希望你也能用上这款评论系统"><meta property="og:type" content="article"><meta property="og:title" content="Waline 评论系统部署日志"><meta property="og:url" content="https://blog.ccknbc.cc/posts/waline-comments-system-deployment-logs/"><meta property="og:site_name" content="CC的部落格"><meta property="og:description" content="Waline 评论系统部署日志，希望你也能用上这款评论系统"><meta property="og:locale" content="zh_CN"><meta property="og:image" content="https://pic1.afdiancdn.com/user/8a7f563c2e3811ecab5852540025c377/common/edd977e4a8569283e89ac7426b67dfc3_w1920_h1080_s366.jpg"><meta property="article:published_time" content="2021-01-16T16:00:00.000Z"><meta property="article:modified_time" content="2021-09-28T13:50:00.000Z"><meta property="article:author" content="CC康纳百川"><meta property="article:tag" content="工具"><meta name="twitter:card" content="summary"><meta name="twitter:image" content="https://pic1.afdiancdn.com/user/8a7f563c2e3811ecab5852540025c377/common/edd977e4a8569283e89ac7426b67dfc3_w1920_h1080_s366.jpg"><link rel="shortcut icon" href="/favicon.ico"><link rel="canonical" href="https://blog.ccknbc.cc/posts/waline-comments-system-deployment-logs/"><link rel="preconnect" href="https://jsd.cdn.zzko.cn"><link rel="preconnect" href="//static.cloudflareinsights.com"><link rel="preconnect" href="//www.clarity.ms"><link rel="preconnect" href="//busuanzi.ibruce.info"><link rel="preconnect" href="https://97MUPN4DMC-dsn.algolia.net" crossorigin=""><meta name="google-site-verification" content="tUkgeN6Ih2ArWtjw47oNSSl4Af2_MWjiKLrzZptUCdM"><meta name="msvalidate.01" content="71ADBCC80D679CEA8080BAFDCD54E368"><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://jsd.cdn.zzko.cn/npm/@fortawesome/fontawesome-free/css/all.min.css"><link rel="stylesheet" href="https://jsd.cdn.zzko.cn/npm/node-snackbar/dist/snackbar.min.css" media="print" onload='this.media="all"'><link rel="stylesheet" href="https://jsd.cdn.zzko.cn/npm/@fancyapps/ui/dist/fancybox/fancybox.css" media="print" onload='this.media="all"'><script>(()=>{const t={set:(e,t,a)=>{var o;0!==a&&(o=Date.now(),localStorage.setItem(e,JSON.stringify({value:t,expiry:o+864e5*a})))},get:e=>{var t=localStorage.getItem(e);if(t){t=JSON.parse(t);if(!(Date.now()>t.expiry))return t.value;localStorage.removeItem(e)}}},a=(window.btf={saveToLocal:t,getScript:(o,n={})=>new Promise((t,e)=>{const a=document.createElement("script");a.src=o,a.async=!0,a.onerror=e,a.onload=a.onreadystatechange=function(){var e=this.readyState;e&&"loaded"!==e&&"complete"!==e||(a.onload=a.onreadystatechange=null,t())},Object.keys(n).forEach(e=>{a.setAttribute(e,n[e])}),document.head.appendChild(a)}),getCSS:(o,n=!1)=>new Promise((t,e)=>{const a=document.createElement("link");a.rel="stylesheet",a.href=o,n&&(a.id=n),a.onerror=e,a.onload=a.onreadystatechange=function(){var e=this.readyState;e&&"loaded"!==e&&"complete"!==e||(a.onload=a.onreadystatechange=null,t())},document.head.appendChild(a)}),addGlobalFn:(e,t,a=!1,o=window)=>{var n=o.globalFn||{},d=n[e]||{};a&&d[a]||(d[a=a||Object.keys(d).length]=t,n[e]=d,o.globalFn=n)}},()=>{document.documentElement.setAttribute("data-theme","dark"),null!==document.querySelector('meta[name="theme-color"]')&&document.querySelector('meta[name="theme-color"]').setAttribute("content","#0d0d0d")}),o=()=>{document.documentElement.setAttribute("data-theme","light"),null!==document.querySelector('meta[name="theme-color"]')&&document.querySelector('meta[name="theme-color"]').setAttribute("content","ffffff")};btf.activateDarkMode=a,btf.activateLightMode=o;var e=t.get("theme"),n=window.matchMedia("(prefers-color-scheme: dark)").matches,d=window.matchMedia("(prefers-color-scheme: light)").matches,r=window.matchMedia("(prefers-color-scheme: no-preference)").matches,c=!n&&!d&&!r,n=(void 0===e?(d?o():n?a():(r||c)&&((d=(new Date).getHours())<=6||18<=d?a:o)(),window.matchMedia("(prefers-color-scheme: dark)").addListener(e=>{void 0===t.get("theme")&&(e.matches?a:o)()})):("light"===e?o:a)(),t.get("aside-status"));void 0!==n&&("hide"===n?document.documentElement.classList.add("hide-aside"):document.documentElement.classList.remove("hide-aside"));/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)&&document.documentElement.classList.add("apple")})()</script><script defer data-pjax="data-pjax" src="https://static.cloudflareinsights.com/beacon.min.js" data-cf-beacon="{&quot;token&quot;: &quot;35785b58f09f472ebfd7a2854973e6b8&quot;}"></script><script>!function(t,e,n,a,c,r){t[n]=t[n]||function(){(t[n].q=t[n].q||[]).push(arguments)},(c=e.createElement(a)).async=1,c.src="https://www.clarity.ms/tag/an4gdfm6a9",(r=e.getElementsByTagName(a)[0]).parentNode.insertBefore(c,r)}(window,document,"clarity","script")</script><script>const GLOBAL_CONFIG={postHeadAiDescription:{enable:!0,gptName:"CC",mode:"tianli",switchBtn:!0,btnLink:"https://tianli-blog.club/tianligpt/",randomNum:3,basicWordCount:1e3,key:"VCtoijR43E2uiVWkrZiC",Referer:"https://blog.ccknbc.cc/"},root:"/",algolia:void 0,localSearch:void 0,translate:{defaultEncoding:2,translateDelay:0,msgToTraditionalChinese:"繁",msgToSimplifiedChinese:"简"},noticeOutdate:{limitDay:15,position:"top",messagePrev:"本文最后一次更新为",messageNext:"天前，文章中的某些内容可能已过时！"},highlight:{plugin:"highlight.js",highlightCopy:!0,highlightLang:!0,highlightHeightLimit:!1,highlightFullpage:!0,highlightMacStyle:!0},copy:{success:"复制成功",error:"复制错误",noSupport:"浏览器不支持"},relativeDate:{homepage:!1,post:!1},runtime:"天",dateSuffix:{just:"刚刚",min:"分钟前",hour:"小时前",day:"天前",month:"个月前"},copyright:{limitCount:100,languages:{author:"作者: CC康纳百川",link:"链接: ",source:"来源: CC的部落格",info:"著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。"}},lightbox:"fancybox",Snackbar:{chs_to_cht:"你已切换为繁体中文",cht_to_chs:"你已切换为简体中文",day_to_night:"你已切换为深色模式",night_to_day:"你已切换为浅色模式",bgLight:"#49b1f5",bgDark:"#1f1f1f",position:"top-center"},infinitegrid:{js:"https://jsd.cdn.zzko.cn/npm/@egjs/infinitegrid/dist/infinitegrid.min.js",buttonText:"加载更多"},isPhotoFigcaption:!1,islazyload:!0,isAnchor:!1,percent:{toc:!0,rightside:!0},autoDarkmode:!0}</script><script id="config-diff">var GLOBAL_CONFIG_SITE={postAI:"Waline 评论系统部署日志，希望你也能用上这款评论系统",pageFillDescription:"特性, Todo, Vercel + LeanCloud 部署, 配置项, CloudBase 云开发部署, 一键部署, 手动部署, 如何升级, Vercel, 手动升级, 自动升级, CloudBase, 一键部署, 手动部署, 手动升级, 自动升级, 附录, 邮件通知模板, 下载本文大部分内容已作废请直接查看官方文档本文首发在语雀自动同步更新至的部落格本文仅作为官方文档的补充若有错误还望指正评论系统部署日志一款从衍生的带后端评论系统可以将等价成特性快速真安全语法支持轻量易用免费部署多种部署部署方式和存储服务支持每列选择一项多达种可以更多部署方式任君选择客户端脚本服务端部署数据存储独立部署对于想免费使用的用户国际版是不错的选择不过一个服务就能解决所有问题而且还快点如果你主要面向对象为大陆用户使用部署也是个不错的选择它在海外表现也没那么差或者您仅使用来做数据存储如果您使用并且使用发送评论通知您不必担心流控问题并且之前使用过或者部署过项目的可以直接拿来用对于评论转移官方提供了迁移助手供您使用不用担心之前评论丢失的问题微信通知通知通知文章统计多语言同步自定义语言支持登录支持评论管理评论删除其它数据库支持基于的发布评论频率限制基于关键词的评论过滤限制黑名单重复内容检测腾讯云开发部署支持社交登录置顶评论评论赞踩其它目前社交登录仅支持未来会支持更多平台部署这部分请前往官方文档查看不过需要注意的是如果你的账号主邮箱是邮箱的话建议更改为其他邮箱毕竟他们认为邮箱是垃圾邮箱再去注册或者你可以选择给客服发一封邮件让他们帮忙解锁你的账号环境变量配置部分官方文档也写了这里不再赘述如果您之前用过那么关于部分你就不用做什么了数据兼容拿到那几个即可配置项这个可直接参考官方文档按需进行配置即可因为目前云开发因众所周知的原因不支持连接服务器所以如果您要配置电报新评论通知请使用进行配置不过因为目前没有异步通知加上反垃圾检测等功能发布评论可能需要很长时间这个我使用了来继续帮我发送通知反正我也没什么评论流控问题第二天补发评论也不是不可对于邮件通知部分目前的设定是对于新评论如果博主配置了微信通知中任意一种或多种则邮件通知将会取消而对于回复子评论博主和被回复者如果填了邮箱的话均可收到邮件通知我目前使用的主题已经从版本起内置了评论系统如果您使用老版本主题请升级或者根据您所用版本的模板来照葫芦画瓢根据官方配置进行对应修改主题中为可选配置万一将来增加了某些配置主题不必为此升级为主题配置项这里注意一下以及环境变量里的网址最后的斜杠因为作者没做兼容所以不要带上导致跳转不到对应评论界面客户端脚本里可以通过这个配置自定义角标的文案例如可爱的管理员对于同主题在主题配置里找到配置项相关内容博主兼管理员昵称选填邮箱必填网址选填这里冷冷清清的快来留下脚印吧如果你查看了源码会发现还有这个可以配置但不建议大家设为啦保留也没什么的没错我不要脸还有就是可能有人会觉得默认邮件通知模板太单调想和一样切换模板其实有这个配置的只是目前的方法是写在环境变量中而环境变量限制长度大小或者说是不适合这种方式配置如果要改的话可以先查看相关内容或者等以后优化再说当然如果你的评论不是很多并且之前配置过那么你仍然可以使用来做异步发送通知关闭默认的通知配置或者使用推送关于邮件模板大家可查看官方文档相关章节或者使用附录提供的邮件通知模板也提交了评论可以根据官方的例子自己做一些配置相比于其他违禁词屏蔽等配置可以说是人性化了但万一配置不好一些正常评论可能也会被判定为垃圾内容所以我推荐使用人工审核功能不过这边不得不说另一个评论系统支持查看自己审核中的评论评论置顶点赞等不过我想将来也能实现毕竟立那了图片上传部分配置理论上是可以适配任何图床配置例子可查看当然内置了一个默认图床开箱即用表情配置和之前是一样的同主题还可使用的配置方式具体可查看主题文档云开发部署一键部署一键脚本部署可以查看官方文档我删了之后就没成功过截至文档最新更新日期这个已被修复不过那个链接还没改所以还是失败不过我只能说作者非常不细心毕竟能一天发十几个版本详见他还是把链接协议头多打了一个所以请点击这里一键部署嗯后来修复了期待接下来的开发警告内容来自官方文档建议您直接查看手动部署部分一键部署虽然方便但是仅支持按量计费环境也就是说一键部署的环境当免费资源用尽后将会产生费用且按量计费环境无法切换为包年包月环境免费额度数据库读操作数只有次天无法支撑的运行需求建议您手动部署以节约成本对于新用户或者说没有创建过按量计费环境的用户会显示如下内容记得勾选开启免费资源为了日后升级的方便不管您是否使用了部署您都可以我的仓库稍加配置即可完成自动部署更新手动部署首先前往腾讯云的活动区域注册登陆后往下滑找到新用户专享云开发标准型基础版资源套餐元购买一个免费包年包月环境没错这个环境不错吧按照提示购买后稍等几分钟在这个界面可查看您所购买的环境有能力的其实可以看一下自动升级和自动升级部分间接实现一键部署自动更新点击云函数新建云函数函数内存选择名称随意例如其他默认单击进入下一步下图中的函数代码部分填入以下代码云原生一体化部署工具点击对应的云函数进入在线编辑页面按照模板仓库里的文件新建对应的文件并复制粘贴对应的内容即可注意点击保存并安装依赖可能会没有反应一会儿然后等待转圈圈部署完毕即可当然还没有结束我们需要点击环境访问服务点击直达如果你想绑定自定义域名可以照图中绑定记得先申请一下证书如果你想要这个可能花的时间有点长点击新建新建触发路径点击保存即可注意路径最后没有等待构建完成后你就可通过对应的链接访问页面了这个链接就是上面提到的例如我的然后我们需要设置安全域名把你的域名放入白名单即可本地测试的话端口也要对应上哦如何升级手动升级找到帮你在创建的仓库叫啦编辑中依赖版本号即可完成升级版本号以为准因为由于考虑到电报机器人自动推送消息过于频繁影响到群友会延迟推送自动升级其实原理还是一样的因为会监控仓库文件的变化来帮我们自动部署那么我们要做的就是自动更改版本号这里你可以用实现定时每隔半小时自动更新并但这样似乎有点浪费资源所以不怎么推荐而我们这个仓库通常都是公开的私有也没关系首先你需要安装一个应用选择免费版计划即可他会帮我们监控所用依赖的版本更新变化并为提交一个我们要做的只是合并而已但手动合并之前也讲过多少有点不方便自动合并我们知道有打标签自动合并工具人自动合并这些大家搜以下关键词就好但这个应用它本身实际上支持自动合并查看官方文档发现在中配置即可示例代码如下其中代理人是为了通知更新的作用与同理但也可删除此段配置同样的也可关闭通知静默自动更新我目前还是用的默认的提交自动合并的方式如果你是公开仓库还可以使用安装完成后他能它免费帮我们自动合并公开仓库的我们设定一个条件比如提交作者为就自动帮我们点击合并并删除多余分支当然这些都需要配置这里具体会在另一篇文档中讲到以上两个应用你可以选择安装到全部仓库或者只安装到选择的仓库如果你想懒的话可以先删除你现有的名为的仓库再我的仓库然后去你的解绑之前的仓库再绑定你的仓库最后点一下重新部署即可但是如果你没用就把里的文件删掉因为涉及到自动部署更新云开发还有环境变量问题如果没设定会导致报错一键部署就是点击我的应用找到点击部署即可手动部署手动升级就是去仓库复制粘贴修改过的文件的事情了如果没有文件改动就点击保存并安装依赖即可知道在哪了吧自动升级原理在上面讲了结合自动升级部分查看这部分其实可以作为上面的手动部署或者自动部署你可以我的仓库进行更改和上面提到的原理差不多只是用到了如果你之前没接触过这些建议使用部署或者上面的一键部署也比较方便在合并后帮我们自动升级部署到云开发解释一下几个密钥您需要在仓库的中配置组织的话可以把常用到的密钥添加为组织密钥比如等变量名变量解释访问密钥可点击这里新建查看访问密钥可点击这里新建查看没什么好加密的就叫算了你想要新建已有函数的名称比如环境可点击这里或这里查看地址栏后也会显示反正就是很多地方都在上面点一下就能看到附录邮件通知模板您在上发表的评论收到了来自的回复上收到了来自的留言见信安您在上发表的评论黑体宋体收到了来自的回复黑体宋体请您签收自动书记人偶竭诚为您服务来自的留言黑体宋体请您过目下载邮件通知模板下载包含您可以下载后根据官方文档提及的变量自行修改相关内容以上代码仅作参考对于本文未涉及到的其他内容请自行查看官方文档如有错误欢迎指正谢谢",title:"Waline 评论系统部署日志",isPost:!0,isHome:!1,isHighlightShrink:!1,isToc:!0,postUpdate:"2021-09-28 21:50:00"}</script><script>"serviceWorker"in navigator&&(navigator.serviceWorker.register("/sw.js",{scope:"/"}).then(r=>{r.onupdatefound=()=>{const e=r.installing;e.onstatechange=()=>{"installed"===e.state&&(navigator.serviceWorker.controller?(void 0!==GLOBAL_CONFIG.Snackbar&&btf.snackbarShow("已刷新缓存，更新为最新内容"),navigator.serviceWorker.controller.postMessage({type:"skipWaiting"})):console.log("第一次注册Service Worker"))}}}),navigator.serviceWorker.addEventListener("message",e=>{e.data&&"refresh"===e.data.type&&(console.log("收到刷新页面请求，开始刷新页面"),window.location.reload())}))</script><link rel="stylesheet" href="https://jsd.cdn.zzko.cn/npm/hexo-butterfly-tag-plugins-plus/lib/assets/font-awesome-animation.min.css" media="defer" onload='this.media="all"'><link rel="stylesheet" href="https://jsd.cdn.zzko.cn/npm/hexo-butterfly-tag-plugins-plus/lib/tag_plugins.css" media="defer" onload='this.media="all"'><meta name="generator" content="Hexo 7.2.0"><link rel="alternate" href="/atom.xml" title="CC的部落格" type="application/atom+xml"><link rel="alternate" href="/rss.xml" title="CC的部落格" type="application/rss+xml"></head><body><script>window.paceOptions={restartOnPushState:!1},btf.addGlobalFn("pjaxSend",()=>{Pace.restart()},"pace_restart")</script><link rel="stylesheet" href="https://jsd.cdn.zzko.cn/gh/CodeByZach/pace/themes/green/pace-theme-flash.css"><script src="https://jsd.cdn.zzko.cn/npm/pace-js/pace.min.js"></script><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src= "" data-lazy-src="https://jsd.cdn.zzko.cn/gh/ccknbc-backup/cdn/logo/logo.png" onerror='onerror=null,src="https://jsd.cdn.zzko.cn/npm/hexo-theme-anzhiyu/source/img/404.jpg"' alt="avatar"></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">38</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">7</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">7</div></a></div><hr class="custom-hr"><div class="menus_items"><div class="menus_item"><span class="site-page group"><i class="fa-fw fa-solid fa-book-reader"></i><span> 文章</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/archives/"><i class="fa-fw fa-solid fa-box-archive"></i><span> 归档</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fa-solid fa-tags"></i><span> 标签</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw fa-solid fa-folder-open"></i><span> 分类</span></a></li></ul></div><div class="menus_item"><span class="site-page group"><i class="fa-fw fa-solid fa-cubes"></i><span> 社交</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/blogroll/"><i class="fa-fw fa-solid fa-link"></i><span> 友链</span></a></li><li><a class="site-page child" href="/moments/"><i class="fa-fw fa-solid fa-blog"></i><span> 友圈</span></a></li><li><a class="site-page child" href="/music/"><i class="fa-fw fa-solid fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/essay/"><i class="fa-fw fa-solid fa-comment-alt"></i><span> 短文</span></a></li></ul></div><div class="menus_item"><span class="site-page group"><i class="fa-fw fa-solid fa-desktop"></i><span> 关于</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/sub/"><i class="fa-fw fa-solid fa-bell"></i><span> 订阅</span></a></li><li><a class="site-page child" href="/about/"><i class="fa-fw fa-solid fa-list-check"></i><span> 本站</span></a></li><li><a class="site-page child" href="/privacy-policy/"><i class="fa-fw fa-solid fa-user-secret"></i><span> 隐私</span></a></li><li><a class="site-page child" target="_blank" rel="noopener external nofollow noreferrer" href="https://cc.instatus.com"><i class="fa-fw fa-solid fa-server"></i><span> 状态</span></a></li></ul></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image:url(https://pic1.afdiancdn.com/user/8a7f563c2e3811ecab5852540025c377/common/edd977e4a8569283e89ac7426b67dfc3_w1920_h1080_s366.jpg)"><nav id="nav"><span id="blog-info"><a href="/" title="CC的部落格"><span class="site-name">CC的部落格</span></a></span><div id="menus"><div id="search-button"><span class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></span></div><div class="menus_items"><div class="menus_item"><span class="site-page group"><i class="fa-fw fa-solid fa-book-reader"></i><span> 文章</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/archives/"><i class="fa-fw fa-solid fa-box-archive"></i><span> 归档</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fa-solid fa-tags"></i><span> 标签</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw fa-solid fa-folder-open"></i><span> 分类</span></a></li></ul></div><div class="menus_item"><span class="site-page group"><i class="fa-fw fa-solid fa-cubes"></i><span> 社交</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/blogroll/"><i class="fa-fw fa-solid fa-link"></i><span> 友链</span></a></li><li><a class="site-page child" href="/moments/"><i class="fa-fw fa-solid fa-blog"></i><span> 友圈</span></a></li><li><a class="site-page child" href="/music/"><i class="fa-fw fa-solid fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/essay/"><i class="fa-fw fa-solid fa-comment-alt"></i><span> 短文</span></a></li></ul></div><div class="menus_item"><span class="site-page group"><i class="fa-fw fa-solid fa-desktop"></i><span> 关于</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/sub/"><i class="fa-fw fa-solid fa-bell"></i><span> 订阅</span></a></li><li><a class="site-page child" href="/about/"><i class="fa-fw fa-solid fa-list-check"></i><span> 本站</span></a></li><li><a class="site-page child" href="/privacy-policy/"><i class="fa-fw fa-solid fa-user-secret"></i><span> 隐私</span></a></li><li><a class="site-page child" target="_blank" rel="noopener external nofollow noreferrer" href="https://cc.instatus.com"><i class="fa-fw fa-solid fa-server"></i><span> 状态</span></a></li></ul></div></div><div id="toggle-menu"><span class="site-page"><i class="fas fa-bars fa-fw"></i></span></div></div></nav><div id="post-info"><h1 class="post-title">Waline 评论系统部署日志</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2021-01-16T16:00:00.000Z" title="发表于 2021-01-17 00:00:00">2021-01-17</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2021-09-28T13:50:00.000Z" title="更新于 2021-09-28 21:50:00">2021-09-28</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E5%B7%A5%E5%85%B7/">工具</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">5.3k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>22分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" data-flag-title="Waline 评论系统部署日志"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><div class="post-ai-description"><div class="ai-title"><i class="fa-solid fa-newspaper"></i><div class="ai-title-text">AI-摘要</div><div id="ai-Toggle" title="CC/Tianli 模式切换">切换</div><i class="fa-solid fa-podcast" title="Tianli 模式下朗读摘要"></i><i class="fa-solid fa-arrow-rotate-right" title="Tianli 模式下刷新摘要"></i><div id="ai-tag">Tianli GPT</div></div><div class="ai-explanation">AI初始化中...</div><div class="ai-btn-box"><div class="ai-btn-item">介绍自己 🙈</div><div class="ai-btn-item">生成摘要 👋</div><div class="ai-btn-item">相关推荐 📖</div><div class="ai-btn-item">前往主页 🏠</div><div class="ai-btn-item" id="go-tianli-blog">前往爱发电购买</div></div><script data-pjax src="/"></script></div><article class="post-content" id="article-container"><div class="note danger simple"><p>本文大部分内容已作废，请直接查看<a target="_blank" rel="noopener external nofollow noreferrer" href="https://waline.js.org/"><strong>官方文档</strong></a></p></div><p>本文首发在<a target="_blank" rel="noopener external nofollow noreferrer" href="https://www.yuque.com/ccknbc/blog/20/"><strong>语雀</strong></a> 自动同步更新至<a href="https://blog.ccknbc.cc/posts/waline-commens-system-deployment-logs/"><strong>CC 的部落格</strong></a> <strong>本文仅作为官方文档的补充，若有错误，还望指正</strong> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://ccknbc.now.sh/posts/waline-commens-system-deployment-logs/#Todo">Waline 评论系统部署日志</a></p><hr><p>Waline - 一款从 <a target="_blank" rel="noopener external nofollow noreferrer" href="https://valine.js.org">Valine</a> 衍生的带后端评论系统。可以将 Waline 等价成 With backend Valine.</p><h2 id="特性">特性<a class="fa-solid fa-hashtag" href="#特性"></a></h2><ul><li>快速</li><li>真·安全</li><li>Markdown 语法支持</li><li>轻量易用</li><li>免费部署</li><li>多种部署部署方式和存储服务支持，每列选择一项多达 84 种（可以更多）部署方式任君选择<table><thead><tr><th></th><th>Waline</th><th></th></tr></thead><tbody><tr><td><strong>客户端脚本</strong></td><td><strong>服务端部署</strong></td><td><strong>数据存储</strong></td></tr><tr><td><a target="_blank" rel="noopener external nofollow noreferrer" href="https://waline.js.org/"><strong>@waline/client</strong></a></td><td>Vercel</td><td>LeanCloud</td></tr><tr><td><a target="_blank" rel="noopener external nofollow noreferrer" href="https://minivaline.js.org/"><strong>MiniValine</strong></a></td><td>CloudBase</td><td>CloudBase</td></tr><tr><td><a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/innc11/AprilComment"><strong>AprilComment</strong></a></td><td>Docker</td><td>MongoDB</td></tr><tr><td></td><td>独立部署</td><td>MySQL</td></tr><tr><td></td><td></td><td>SQLite</td></tr><tr><td></td><td></td><td>PostgreSQL</td></tr><tr><td></td><td></td><td>GitHub</td></tr></tbody></table></li></ul><p>对于想免费使用的用户， <code>Vercel</code>  + <code>LeanCloud（国际版）</code>  是不错的选择，不过<code>Deta</code>一个服务就能解决所有问题而且还快点，如果你主要面向对象为大陆用户，使用 <code>CloudBase</code>  部署也是个不错的选择，它在海外表现也没那么差，或者您仅使用 <code>CloudBase</code>  来做数据存储</p><div class="note warning simple"><p>如果您使用 <code>Vercel</code> + <code>LeanCloud</code> ，并且使用 <code>Vercel</code>  发送评论通知，您不必担心 LeanCloud 流控问题，并且之前使用过 Valine 或者部署过 <code>Valine-Admin</code>  项目的可以直接拿来用；对于评论转移，官方提供了<a target="_blank" rel="noopener external nofollow noreferrer" href="https://waline.js.org/migration/tool.html">迁移助手</a>供您使用，不用担心之前评论丢失的问题</p></div><h2 id="Todo">Todo<a class="fa-solid fa-hashtag" href="#Todo"></a></h2><div class="checkbox green checked"><input type="checkbox" checked><p>微信通知</p></div><div class="checkbox green checked"><input type="checkbox" checked><p>QQ 通知</p></div><div class="checkbox green checked"><input type="checkbox" checked><p>Telegram 通知</p></div><div class="checkbox green checked"><input type="checkbox" checked><p>Akismet</p></div><div class="checkbox green checked"><input type="checkbox" checked><p>文章统计</p></div><div class="checkbox green checked"><input type="checkbox" checked><p>多语言同步</p></div><div class="checkbox green checked"><input type="checkbox" checked><p>自定义语言支持</p></div><div class="checkbox green checked"><input type="checkbox" checked><p>登录支持</p></div><div class="checkbox green checked"><input type="checkbox" checked><p>评论管理</p></div><div class="checkbox green checked"><input type="checkbox" checked><p>评论删除</p></div><div class="checkbox green checked"><input type="checkbox" checked><p>其它数据库支持</p></div><div class="checkbox green checked"><input type="checkbox" checked><p>基于 IP 的发布评论频率限制</p></div><div class="checkbox green checked"><input type="checkbox" checked><p>基于关键词的评论过滤限制</p></div><div class="checkbox green checked"><input type="checkbox" checked><p>IP 黑名单</p></div><div class="checkbox green checked"><input type="checkbox" checked><p>重复内容检测</p></div><div class="checkbox green checked"><input type="checkbox" checked><p>CloudBase 腾讯云开发部署支持</p></div><div class="checkbox green checked"><input type="checkbox" checked><p>社交登录</p></div><div class="checkbox red"><input type="checkbox"><p>AWS</p></div><div class="checkbox red"><input type="checkbox"><p>置顶评论</p></div><div class="checkbox red"><input type="checkbox"><p>评论赞踩</p></div><div class="checkbox blue"><input type="checkbox"><p>其它…</p></div><div class="note warning simple"><p>目前社交登录仅支持 <code>GitHub</code> ， 未来会支持更多平台</p></div><hr><h2 id="Vercel-LeanCloud-部署">Vercel + LeanCloud 部署<a class="fa-solid fa-hashtag" href="#Vercel-LeanCloud-部署"></a></h2><p>这部分请前往<a target="_blank" rel="noopener external nofollow noreferrer" href="https://waline.js.org/quick-start.html">官方文档</a>查看，不过需要注意的是如果你的 <code>GitHub</code>  账号主邮箱是 <code>QQ</code>  邮箱的话建议更改为其他邮箱（毕竟他们认为 QQ 邮箱是垃圾邮箱）再去注册 Vercel（或者你可以选择给客服发一封邮件让他们帮忙解锁你的账号），环境变量配置部分官方文档也写了，这里不再赘述如果您之前用过 Valine，那么关于 LeanCloud 部分你就不用做什么了，数据兼容，拿到那几个 <code>key</code>  即可</p><h3 id="配置项">配置项<a class="fa-solid fa-hashtag" href="#配置项"></a></h3><p>这个可直接参考官方文档按需进行配置即可，因为目前云开发因众所周知的原因不支持连接 <code>Telegram</code>  服务器，所以如果您要配置电报新评论通知，请使用 Vercel 进行配置，不过因为目前没有异步通知，加上反垃圾检测等功能，发布评论可能需要很长时间，这个我使用了 LeanCloud 来继续帮我发送通知（反正我也没什么评论，流控问题第二天补发评论也不是不可）</p><div class="note warning simple"><p>对于邮件通知部分，目前的设定是，对于新评论，如果博主配置了 QQ/微信/Telegram 通知中任意一种或多种，则邮件通知将会取消，而对于回复（子评论），博主和被回复者（如果填了邮箱的话）均可收到邮件通知</p></div><p>我目前使用的 Hexo Butterfly 主题已经从 3.5.0 beta3 版本起内置了 Waline 评论系统，如果您使用老版本主题请升级，或者根据您所用版本的 Valine 模板 pug 来照葫芦画瓢，根据官方配置进行对应修改，主题中 option 为可选配置，万一将来增加了某些配置，主题不必为此升级, bg 为主题配置项这里注意一下 serverURL 以及环境变量里的 SITE_URL 网址最后的斜杠因为作者没做兼容，所以不要带上 / ，导致跳转不到对应评论界面客户端脚本里可以通过 <code>langMode.admin</code>  这个配置自定义角标的文案,例如：</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">function</span> <span class="title function_">waline</span>(<span class="params"></span>) &#123;</span><br><span class="line">  <span class="keyword">const</span> <span class="title class_">Waline</span> = <span class="built_in">require</span>(<span class="string">&quot;@waline/client&quot;</span>);</span><br><span class="line">  <span class="keyword">new</span> <span class="title class_">Waline</span>(&#123;</span><br><span class="line">    <span class="attr">el</span>: <span class="string">&quot;#waline-comment&quot;</span>,</span><br><span class="line">    <span class="attr">serverURL</span>: <span class="string">&quot;https://waline.vercel.app&quot;</span>,</span><br><span class="line">    <span class="attr">path</span>: <span class="variable language_">window</span>.<span class="property">location</span>.<span class="property">pathname</span>,</span><br><span class="line">    <span class="attr">visitor</span>: <span class="literal">true</span>,</span><br><span class="line">    <span class="attr">lang</span>: location.<span class="property">pathname</span>.<span class="title function_">startsWith</span>(<span class="string">&quot;/en/&quot;</span>) ? <span class="string">&quot;en&quot;</span> : <span class="string">&quot;zh-CN&quot;</span>,</span><br><span class="line">    <span class="attr">langMode</span>: &#123;</span><br><span class="line">      <span class="attr">admin</span>: location.<span class="property">pathname</span>.<span class="title function_">startsWith</span>(<span class="string">&quot;/en/&quot;</span>)</span><br><span class="line">        ? <span class="string">&quot;Administrator&quot;</span></span><br><span class="line">        : <span class="string">&quot;可爱的管理员&quot;</span>,</span><br><span class="line">    &#125;,</span><br><span class="line">  &#125;);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><p>对于同主题在主题配置里找到 <code>waline</code>  配置项相关内容</p><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># waline - A simple comment system with backend support fork from Valine</span></span><br><span class="line"><span class="comment"># https://waline.js.org/</span></span><br><span class="line"><span class="attr">waline:</span></span><br><span class="line">  <span class="attr">serverURL:</span> <span class="string">https://waline.ccknbc.ml</span> <span class="comment"># Waline server address url</span></span><br><span class="line">  <span class="attr">avatar:</span> <span class="string">monsterid</span> <span class="comment"># gravatar style https://zh-tw.gravatar.com/site/implement/images/#default-image</span></span><br><span class="line">  <span class="attr">bg:</span> <span class="comment"># waline background</span></span><br><span class="line">  <span class="attr">emojiCDN:</span> <span class="string">https://cdn.jsdelivr.net/gh/GamerNoTitle/ValineCDN@master/</span></span><br><span class="line">  <span class="attr">visitor:</span> <span class="literal">false</span></span><br><span class="line">  <span class="attr">option:</span></span><br><span class="line">    <span class="attr">pageSize:</span> <span class="number">10</span></span><br><span class="line">    <span class="attr">requiredFields:</span> <span class="string">mail</span></span><br><span class="line">    <span class="comment"># anonymous: false</span></span><br><span class="line">    <span class="attr">placeholder:</span></span><br><span class="line">    <span class="attr">avatarCDN:</span> <span class="string">https://sdn.geekzu.org/avatar/</span></span><br><span class="line">    <span class="comment">#https://valinecdn.bili33.top/</span></span><br><span class="line">    <span class="attr">langMode:</span></span><br><span class="line">      <span class="attr">admin:</span> <span class="string">博主兼管理员</span></span><br><span class="line">      <span class="attr">nick:</span> <span class="string">昵称(选填)</span></span><br><span class="line">      <span class="attr">mail:</span> <span class="string">邮箱(必填)</span></span><br><span class="line">      <span class="attr">link:</span> <span class="string">网址(选填)</span></span><br><span class="line">      <span class="attr">sofa:</span> <span class="string">这里冷冷清清的，快来留下脚印吧！</span></span><br><span class="line">  <span class="comment"># 如果你查看了源码，会发现还有这个可以配置 copyRight: false，但不建议大家设为 false 啦，保留也没什么的（没错，我不要脸）</span></span><br></pre></td></tr></table></figure><p><s>还有就是可能有人会觉得默认邮件通知模板太单调，想和 Valine-Admin 一样切换模板，其实有这个配置的，只是目前的方法是写在环境变量中，而环境变量限制长度（大小），或者说是不适合这种方式配置，如果要改的话可以先查看</s><a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/lizheming/waline/issues/106"><s>issues/106</s></a><s>相关内容，或者等以后优化再说；当然如果你的评论不是很多，并且之前配置过 Valine-Admin，那么你仍然可以使用 LeanCloud 来做异步发送通知，关闭默认的通知配置，或者使用 js 推送</s>关于邮件模板大家可查看<a target="_blank" rel="noopener external nofollow noreferrer" href="https://waline.js.org/server/notification.html#%E9%80%9A%E7%9F%A5%E6%A8%A1%E6%9D%BF">官方文档</a>相关章节，或者使用<a href="#%E9%82%AE%E4%BB%B6%E9%80%9A%E7%9F%A5%E6%A8%A1%E6%9D%BF">附录提供的邮件通知模板</a>，也提交了 PR</p><p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://waline.js.org/server/basic.html#%E8%AF%84%E8%AE%BA-hooks">评论 Hooks</a>，可以根据官方的例子自己做一些配置，相比于其他，违禁词，屏蔽 IP 等配置可以说是人性化了，但万一配置不好一些正常评论可能也会被判定为垃圾内容，所以我推荐使用人工审核功能，不过这边不得不说另一个评论系统 <a target="_blank" rel="noopener external nofollow noreferrer" href="https://twikoo.js.org/">Twikoo</a>，支持查看自己审核中的评论，评论置顶，点赞等，不过我想 Waline 将来也能实现，毕竟 Flag 立那了</p><p>图片上传 uploadImage 部分配置 理论上是可以适配任何图床，配置例子可查看 <a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/lizheming/waline/issues/123">issues/123</a>，当然内置了一个默认图床，开箱即用</p><p>表情配置和之前 Valine 是一样的，同主题还可使用 <code>walien.json</code>  的配置方式，具体可查看<a target="_blank" rel="noopener external nofollow noreferrer" href="https://butterfly.js.org/posts/ceeb73f/#%E8%A9%95%E8%AB%96">主题文档</a></p><h2 id="CloudBase-云开发部署">CloudBase 云开发部署<a class="fa-solid fa-hashtag" href="#CloudBase-云开发部署"></a></h2><h3 id="一键部署">一键部署<a class="fa-solid fa-hashtag" href="#一键部署"></a></h3><p>一键脚本部署可以查看<a target="_blank" rel="noopener external nofollow noreferrer" href="https://waline.js.org/server/cloudbase.html">官方文档</a>，我删了之后就没成功过<img src= "" data-lazy-src="https://cdn.nlark.com/yuque/0/2021/png/8391407/1612362992018-14b2a225-27d6-4996-948b-e746d26bb2e0.png#averageHue=%23605f5f&amp;height=322&amp;id=FOuRW&amp;originHeight=644&amp;originWidth=1011&amp;originalType=binary&amp;ratio=1&amp;rotation=0&amp;showTitle=false&amp;size=48650&amp;status=done&amp;style=none&amp;title=&amp;width=505.5" alt="image.png" loading="lazy"> 截至文档最新更新日期，这个已被修复（不过 tcb-starter 那个链接还没改所以还是失败），不过我只能说作者非常不细心，毕竟能一天发十几个版本，详见 <a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/lizheming/waline/commit/d87d3092a34fd6b2b7f0b1c72bd95ad784a086e7">commit</a>，他还是把链接协议头多打了一个 h ,所以请<a target="_blank" rel="noopener external nofollow noreferrer" href="https://console.cloud.tencent.com/tcb/env/index?action=CreateAndDeployCloudBaseProject&amp;appUrl=https%3A%2F%2Fgithub.com%2Fwalinejs%2Ftcb-starter&amp;branch=master&amp;appName=waline">点击这里</a>一键部署嗯，后来修复了，期待接下来的开发</p><hr><p>警告内容来自 <a target="_blank" rel="noopener external nofollow noreferrer" href="https://twikoo.js.org/quick-start.html">Twikoo 官方文档</a> 建议您直接查看 <a href="#%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2">手动部署部分</a>！！！</p><div class="note warning simple"><p>一键部署虽然方便，但是仅支持按量计费环境——也就是说，<strong>一键部署的环境，当免费资源用尽后，将会产生费用</strong>。且按量计费环境无法切换为包年包月环境。免费额度数据库读操作数只有 500 次 / 天，<strong>无法支撑 Twikoo 的运行需求</strong>。Twikoo 建议您<a href="#%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2">手动部署</a>以节约成本。</p></div><p><img src= "" data-lazy-src="https://cdn.nlark.com/yuque/0/2021/png/8391407/1610953378969-db93161e-24d3-4a48-8934-5566774b94d2.png#averageHue=%23ebcf90&amp;height=204&amp;id=BbUHK&amp;originHeight=204&amp;originWidth=423&amp;originalType=binary&amp;ratio=1&amp;rotation=0&amp;showTitle=false&amp;size=11059&amp;status=done&amp;style=none&amp;title=&amp;width=423" alt="image.png" loading="lazy"> 对于新用户或者说没有创建过按量计费环境的用户会显示如下内容，记得勾选开启免费资源 <img src= "" data-lazy-src="https://cdn.nlark.com/yuque/0/2021/png/8391407/1610873567827-825cde85-7c99-4c5a-95e0-44c0966784cb.png#averageHue=%23fbfbfb&amp;height=632&amp;id=v1Ort&amp;originHeight=632&amp;originWidth=1006&amp;originalType=binary&amp;ratio=1&amp;rotation=0&amp;showTitle=false&amp;size=46404&amp;status=done&amp;style=none&amp;title=&amp;width=1006" alt="image.png" loading="lazy"> <img src= "" data-lazy-src="https://cdn.nlark.com/yuque/0/2021/png/8391407/1612859364523-006d98ba-bd5c-4868-878f-9c9ac158d836.png#averageHue=%23fdfdfd&amp;height=237&amp;id=EOKkv&amp;originHeight=473&amp;originWidth=999&amp;originalType=binary&amp;ratio=1&amp;rotation=0&amp;showTitle=false&amp;size=25755&amp;status=done&amp;style=none&amp;title=&amp;width=499.5" alt="image.png" loading="lazy"></p><p>为了日后升级的方便，不管您是否使用了 Vercel 部署，您都可以 fork <a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/ccknbc-actions/waline">我的仓库</a> ，稍加配置即可完成自动部署更新</p><h3 id="手动部署">手动部署<a class="fa-solid fa-hashtag" href="#手动部署"></a></h3><p>首先前往<a target="_blank" rel="noopener external nofollow noreferrer" href="https://cloud.tencent.com/act/pro/cloudbase01"><strong>腾讯云的活动区域</strong></a>，注册/登陆后往下滑，找到新用户专享云开发标准型（基础版 1）资源套餐，0 元购买一个免费包年包月环境</p><hr><p>没错，这个环境不错吧<img src= "" data-lazy-src="https://cdn.nlark.com/yuque/0/2021/png/8391407/1610870670315-08e65148-3819-48fb-878e-03fdb0c9ab64.png#averageHue=%23e4c69f&amp;height=536&amp;id=DWotB&amp;originHeight=536&amp;originWidth=1493&amp;originalType=binary&amp;ratio=1&amp;rotation=0&amp;showTitle=false&amp;size=52310&amp;status=done&amp;style=none&amp;title=&amp;width=1493" alt="image.png" loading="lazy"> 按照提示购买后稍等几分钟，<a target="_blank" rel="noopener external nofollow noreferrer" href="https://console.cloud.tencent.com/tcb/env/index">在这个界面可查看您所购买的环境</a><img src= "" data-lazy-src="https://cdn.nlark.com/yuque/0/2021/png/8391407/1610870083481-8e4cad1a-c70a-4cad-9192-11be8003241c.png#averageHue=%23fcfbfb&amp;height=233&amp;id=Q9Z3p&amp;originHeight=233&amp;originWidth=523&amp;originalType=binary&amp;ratio=1&amp;rotation=0&amp;showTitle=false&amp;size=10168&amp;status=done&amp;style=none&amp;title=&amp;width=523" alt="image.png" loading="lazy"> 有能力的其实可以看一下 Vercel <a href="#%E8%87%AA%E5%8A%A8%E5%8D%87%E7%BA%A7">自动升级</a>和 TCB<a href="#%E8%87%AA%E5%8A%A8%E5%8D%87%E7%BA%A7-1">自动升级</a>部分，间接实现一键部署，自动更新<a target="_blank" rel="noopener external nofollow noreferrer" href="https://console.cloud.tencent.com/tcb/scf/index">点击云函数</a>，新建云函数，函数内存选择 128M，名称随意，例如 Waline，其他默认,单击进入下一步<img src= "" data-lazy-src="https://cdn.nlark.com/yuque/0/2021/png/8391407/1612359288449-66b53150-2146-4ec9-aa08-910b99aebd1b.png#averageHue=%2328231a&amp;height=448&amp;id=gqDSy&amp;originHeight=895&amp;originWidth=1917&amp;originalType=binary&amp;ratio=1&amp;rotation=0&amp;showTitle=false&amp;size=127338&amp;status=done&amp;style=none&amp;title=&amp;width=958.5" alt="image.png" loading="lazy"> 下图中的函数代码部分填入以下代码 <img src= "" data-lazy-src="https://cdn.nlark.com/yuque/0/2021/png/8391407/1612359460424-4b8cf9b4-2ef4-4758-92f6-09ae040a91ea.png#averageHue=%23fcfcfb&amp;height=396&amp;id=QsO9K&amp;originHeight=791&amp;originWidth=688&amp;originalType=binary&amp;ratio=1&amp;rotation=0&amp;showTitle=false&amp;size=43150&amp;status=done&amp;style=none&amp;title=&amp;width=344" alt="image.png" loading="lazy"></p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * Tencent is pleased to support the open source community by making CloudBaseFramework - 云原生一体化部署工具 available.</span></span><br><span class="line"><span class="comment"> *</span></span><br><span class="line"><span class="comment"> * Copyright (C) 2020 THL A29 Limited, a Tencent company.  All rights reserved.</span></span><br><span class="line"><span class="comment"> *</span></span><br><span class="line"><span class="comment"> * Please refer to license text included with this package for license details.</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="variable language_">module</span>.<span class="property">exports</span>.<span class="property">main</span> = <span class="keyword">async</span> (event, context) =&gt; &#123;</span><br><span class="line">  context.<span class="property">callbackWaitsForEmptyEventLoop</span> = <span class="literal">false</span>;</span><br><span class="line">  <span class="keyword">const</span> entry = (<span class="function">() =&gt;</span> &#123;</span><br><span class="line">    <span class="keyword">const</span> result = <span class="built_in">require</span>(<span class="string">&quot;./app.js&quot;</span>);</span><br><span class="line">    <span class="comment">// const app = require(&#x27;express&#x27;)();</span></span><br><span class="line">    <span class="comment">// result = app.use(result);</span></span><br><span class="line">    <span class="keyword">return</span> result;</span><br><span class="line">  &#125;)();</span><br><span class="line">  <span class="keyword">const</span> serverless = <span class="built_in">require</span>(<span class="string">&quot;serverless-http&quot;</span>);</span><br><span class="line">  <span class="keyword">let</span> app = entry;</span><br><span class="line"></span><br><span class="line">  <span class="comment">// support for async load app</span></span><br><span class="line">  <span class="keyword">if</span> (entry &amp;&amp; entry.<span class="property">tcbGetApp</span> &amp;&amp; <span class="keyword">typeof</span> entry.<span class="property">tcbGetApp</span> === <span class="string">&quot;function&quot;</span>) &#123;</span><br><span class="line">    app = <span class="keyword">await</span> entry.<span class="title function_">tcbGetApp</span>();</span><br><span class="line">  &#125;</span><br><span class="line"></span><br><span class="line">  <span class="keyword">return</span> <span class="title function_">serverless</span>(app, &#123;</span><br><span class="line">    <span class="attr">binary</span>: [</span><br><span class="line">      <span class="string">&quot;application/javascript&quot;</span>,</span><br><span class="line">      <span class="string">&quot;application/json&quot;</span>,</span><br><span class="line">      <span class="string">&quot;application/octet-stream&quot;</span>,</span><br><span class="line">      <span class="string">&quot;application/xml&quot;</span>,</span><br><span class="line">      <span class="string">&quot;font/eot&quot;</span>,</span><br><span class="line">      <span class="string">&quot;font/opentype&quot;</span>,</span><br><span class="line">      <span class="string">&quot;font/otf&quot;</span>,</span><br><span class="line">      <span class="string">&quot;image/*&quot;</span>,</span><br><span class="line">      <span class="string">&quot;video/*&quot;</span>,</span><br><span class="line">      <span class="string">&quot;audio/*&quot;</span>,</span><br><span class="line">      <span class="string">&quot;text/comma-separated-values&quot;</span>,</span><br><span class="line">      <span class="string">&quot;text/css&quot;</span>,</span><br><span class="line">      <span class="string">&quot;text/javascript&quot;</span>,</span><br><span class="line">      <span class="string">&quot;text/plain&quot;</span>,</span><br><span class="line">      <span class="string">&quot;text/text&quot;</span>,</span><br><span class="line">      <span class="string">&quot;text/xml&quot;</span>,</span><br><span class="line">    ],</span><br><span class="line">  &#125;)(event, context);</span><br><span class="line">&#125;;</span><br></pre></td></tr></table></figure><p>点击对应的云函数，进入在线编辑页面，按照<a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/walinejs/tcb-starter">模板仓库</a>里的文件，新建对应的文件，并复制粘贴对应的内容即可<img src= "" data-lazy-src="https://cdn.nlark.com/yuque/0/2021/png/8391407/1612360652232-9eb2ad2b-bebe-4964-bb5f-75e2f9946d25.png#averageHue=%23f6f6f6&amp;height=283&amp;id=t6ZUG&amp;originHeight=566&amp;originWidth=1171&amp;originalType=binary&amp;ratio=1&amp;rotation=0&amp;showTitle=false&amp;size=59625&amp;status=done&amp;style=none&amp;title=&amp;width=585.5" alt="image.png" loading="lazy"> 注意点击<strong>保存并安装依赖</strong>，可能会没有反应一会儿，然后等待转圈圈部署完毕即可<img src= "" data-lazy-src="https://cdn.nlark.com/yuque/0/2021/png/8391407/1612360855940-241970ec-5c18-4bc8-9168-9fd945deb761.png#averageHue=%23f5e7e7&amp;height=71&amp;id=PlC1K&amp;originHeight=142&amp;originWidth=264&amp;originalType=binary&amp;ratio=1&amp;rotation=0&amp;showTitle=false&amp;size=4012&amp;status=done&amp;style=none&amp;title=&amp;width=132" alt="image.png" loading="lazy"><img src= "" data-lazy-src="https://cdn.nlark.com/yuque/0/2021/png/8391407/1612361085479-f39b6b2b-2293-4685-882e-9e20aa611dea.png#averageHue=%23ccf1dd&amp;height=32&amp;id=qWtmj&amp;originHeight=64&amp;originWidth=251&amp;originalType=binary&amp;ratio=1&amp;rotation=0&amp;showTitle=false&amp;size=3262&amp;status=done&amp;style=none&amp;title=&amp;width=125.5" alt="image.png" loading="lazy"> 当然还没有结束，我们需要点击 <code>环境 --&gt; HTTP 访问服务</code> （<a target="_blank" rel="noopener external nofollow noreferrer" href="https://console.cloud.tencent.com/tcb/env/access">点击直达</a>)，如果你想绑定自定义域名可以照图中绑定，记得先申请一下证书，如果你想要 HTTPS（这个可能花的时间有点长）<img src= "" data-lazy-src="https://cdn.nlark.com/yuque/0/2021/png/8391407/1612361294908-3ef584b5-5cbc-43e5-b744-cda357057ec0.png#averageHue=%23fdfdfd&amp;height=336&amp;id=Y8wtR&amp;originHeight=671&amp;originWidth=1596&amp;originalType=binary&amp;ratio=1&amp;rotation=0&amp;showTitle=false&amp;size=62417&amp;status=done&amp;style=none&amp;title=&amp;width=798" alt="image.png" loading="lazy"> 点击新建，新建触发路径，点击保存即可，注意路径最后没有 / ，等待构建完成后你就可通过对应的链接访问 demo 页面了，这个链接就是上面提到的 <code>serverURL</code> ，例如我的 <a target="_blank" rel="noopener external nofollow noreferrer" href="https://tcb.ccknbc.cc/waline">https://tcb.ccknbc.cc/waline</a> <img src= "" data-lazy-src="https://cdn.nlark.com/yuque/0/2021/png/8391407/1612361631129-fecd45a5-f694-4154-8707-9976eb10adb5.png#averageHue=%23fcfcfc&amp;height=268&amp;id=EJKha&amp;originHeight=535&amp;originWidth=753&amp;originalType=binary&amp;ratio=1&amp;rotation=0&amp;showTitle=false&amp;size=29976&amp;status=done&amp;style=none&amp;title=&amp;width=376.5" alt="image.png" loading="lazy"> 然后我们需要设置<a target="_blank" rel="noopener external nofollow noreferrer" href="https://console.cloud.tencent.com/tcb/env/safety"> WEB 安全域名</a>，把你的域名放入白名单即可（本地测试的话端口也要对应上哦）</p><h2 id="如何升级">如何升级<a class="fa-solid fa-hashtag" href="#如何升级"></a></h2><h3 id="Vercel">Vercel<a class="fa-solid fa-hashtag" href="#Vercel"></a></h3><h4 id="手动升级">手动升级<a class="fa-solid fa-hashtag" href="#手动升级"></a></h4><p>找到 Vercel 帮你在创建的仓库，叫 <code>waline</code>  啦，编辑 <code>package.json</code>  中依赖版本号即可完成升级，版本号以 <code>npm</code> <img src= "" data-lazy-src="https://img.shields.io/npm/v/@waline/vercel?color=critical&amp;logo=npm&amp;style=flat-square#height=20&amp;id=ZBPqj&amp;originHeight=20&amp;originWidth=105&amp;originalType=binary&amp;ratio=1&amp;rotation=0&amp;showTitle=false&amp;status=done&amp;style=none&amp;title=&amp;width=105" alt="" loading="lazy">  为准，因为 GitHub 由于考虑到电报机器人自动推送消息过于频繁影响到群友，会延迟推送</p><h4 id="自动升级">自动升级<a class="fa-solid fa-hashtag" href="#自动升级"></a></h4><p>其实原理还是一样的，因为 Vercel 会监控仓库文件的变化来帮我们自动部署，那么我们要做的就是自动更改版本号，这里你可以用 <code>Github Actions</code>  实现，定时每隔半小时自动更新并 push，但这样似乎有点浪费资源，所以不怎么推荐，而我们这个仓库通常都是公开的（私有也没关系）首先你需要安装一个应用<a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/marketplace/renovate">Renovate</a>,选择免费版计划即可，他会帮我们监控所用依赖的版本更新变化，并为提交一个 <code>PR</code> ，我们要做的只是合并 PR 而已，但手动合并之前也讲过，多少有点不方便，自动合并我们知道有打标签自动合并，GitHub Actions 工具人自动合并，这些大家搜以下关键词就好，但这个应用它本身实际上支持自动合并，查看<a target="_blank" rel="noopener external nofollow noreferrer" href="https://docs.renovatebot.com/configuration-options/#automerge">官方文档</a>发现在 <code>renovate.json</code>  中配置即可，示例代码如下，其中代理人是为了通知更新的作用，与 PR 同理，但也可删除此段配置，同样的 PR 也可关闭通知静默自动更新。</p><figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="punctuation">&#123;</span></span><br><span class="line">  <span class="attr">&quot;extends&quot;</span><span class="punctuation">:</span> <span class="punctuation">[</span><span class="string">&quot;config:base&quot;</span><span class="punctuation">]</span><span class="punctuation">,</span></span><br><span class="line">  <span class="attr">&quot;assignees&quot;</span><span class="punctuation">:</span> <span class="punctuation">[</span><span class="string">&quot;CCKNBC&quot;</span><span class="punctuation">]</span><span class="punctuation">,</span></span><br><span class="line">  <span class="attr">&quot;separateMinorPatch&quot;</span><span class="punctuation">:</span> <span class="literal"><span class="keyword">true</span></span><span class="punctuation">,</span></span><br><span class="line">  <span class="attr">&quot;packageRules&quot;</span><span class="punctuation">:</span> <span class="punctuation">[</span></span><br><span class="line">    <span class="punctuation">&#123;</span></span><br><span class="line">      <span class="attr">&quot;updateTypes&quot;</span><span class="punctuation">:</span> <span class="punctuation">[</span><span class="string">&quot;minor&quot;</span><span class="punctuation">,</span> <span class="string">&quot;patch&quot;</span><span class="punctuation">]</span><span class="punctuation">,</span></span><br><span class="line">      <span class="attr">&quot;automerge&quot;</span><span class="punctuation">:</span> <span class="literal"><span class="keyword">true</span></span><span class="punctuation">,</span></span><br><span class="line">      <span class="attr">&quot;automergeType&quot;</span><span class="punctuation">:</span> <span class="string">&quot;branch&quot;</span></span><br><span class="line">    <span class="punctuation">&#125;</span></span><br><span class="line">  <span class="punctuation">]</span></span><br><span class="line"><span class="punctuation">&#125;</span></span><br></pre></td></tr></table></figure><p>我目前还是用的默认的提交 PR 自动合并的方式，如果你是公开仓库，还可以使用<a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/marketplace/mergify">Mergify</a>，安装完成后他能它免费帮我们自动合并公开仓库的 PR，我们设定一个条件，比如 PR 提交作者为 renovate，就自动帮我们点击合并，并删除多余分支，当然这些都需要配置，这里具体会在另一篇文档中讲到</p><div class="note info simple"><p>以上两个应用你可以选择安装到全部仓库，或者只安装到选择的仓库</p></div><p>如果你想懒的话可以先删除你现有的名为 Waine 的仓库，再 fork <a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/ccknbc-actions/waline">我的仓库</a>，然后去你的 Vercel 解绑之前的仓库，再绑定你 fork 的仓库，最后点一下重新部署即可但是如果你没用 tcb 就把 <code>.github/workflows/Update Waline TCB.yml</code>   里的文件删掉，因为涉及到自动部署更新云开发，还有环境变量问题，如果没设定会导致报错</p><h3 id="CloudBase">CloudBase<a class="fa-solid fa-hashtag" href="#CloudBase"></a></h3><hr><h4 id="一键部署-2">一键部署<a class="fa-solid fa-hashtag" href="#一键部署-2"></a></h4><p>就是点击<a target="_blank" rel="noopener external nofollow noreferrer" href="https://console.cloud.tencent.com/tcb/apps/index">我的应用</a>找到 Waline 点击部署即可 <img src= "" data-lazy-src="https://cdn.nlark.com/yuque/0/2021/png/8391407/1612711217029-250d0b1a-75d1-4a7c-9f4c-8a9413ab51fa.png#averageHue=%2389cec5&amp;height=409&amp;id=jhuJB&amp;originHeight=818&amp;originWidth=1814&amp;originalType=binary&amp;ratio=1&amp;rotation=0&amp;showTitle=false&amp;size=86907&amp;status=done&amp;style=none&amp;title=&amp;width=907" alt="image.png" loading="lazy"></p><h4 id="手动部署-2">手动部署<a class="fa-solid fa-hashtag" href="#手动部署-2"></a></h4><h5 id="手动升级-2">手动升级<a class="fa-solid fa-hashtag" href="#手动升级-2"></a></h5><p>就是去<a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/walinejs/tcb-starter">仓库</a>复制粘贴修改过的文件的事情了，如果没有文件改动就点击 <code>保存并安装依赖</code>  即可（知道在哪了吧）</p><h5 id="自动升级-2">自动升级<a class="fa-solid fa-hashtag" href="#自动升级-2"></a></h5><p>原理在上面讲了，结合 <a href="#%E8%87%AA%E5%8A%A8%E5%8D%87%E7%BA%A7">Vercel 自动升级</a>部分查看，这部分其实可以作为上面的手动部署，或者自动部署？你可以 fork <a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/ccknbc-actions/waline">我的仓库</a> 进行更改，和上面提到的原理差不多，只是用到了 Actions（如果你之前没接触过这些，建议使用 Vercel 部署或者上面的一键部署，也比较方便），在合并 PR 后帮我们自动升级部署到云开发，解释一下几个密钥，您需要在 仓库的 <code>settings/secrets/actions</code> 中配置，组织的话可以把常用到的密钥添加为组织密钥，比如 ID KEY 等</p><table><thead><tr><th>变量名</th><th>变量解释</th></tr></thead><tbody><tr><td>SECRETID</td><td>API 访问密钥 ID，可<a target="_blank" rel="noopener external nofollow noreferrer" href="https://console.cloud.tencent.com/cam/capi">点击这里</a>新建/查看</td></tr><tr><td>SECRETKEY</td><td>API 访问密钥 KEY，可<a target="_blank" rel="noopener external nofollow noreferrer" href="https://console.cloud.tencent.com/cam/capi">点击这里</a>新建/查看</td></tr><tr><td>TCBFUNNAME（没什么好加密的，就叫 waline 算了）</td><td>你想要新建/已有函数的名称，比如 <code>Waline</code></td></tr><tr><td>TCBENVID</td><td>环境 ID，可<a target="_blank" rel="noopener external nofollow noreferrer" href="https://console.cloud.tencent.com/tcb/env/overview">点击这里</a>或<a target="_blank" rel="noopener external nofollow noreferrer" href="https://console.cloud.tencent.com/tcb/env/index">这里</a>查看，地址栏后也会显示，反正就是很多地方都在上面点一下就能看到</td></tr></tbody></table><h2 id="附录">附录<a class="fa-solid fa-hashtag" href="#附录"></a></h2><h3 id="邮件通知模板">邮件通知模板<a class="fa-solid fa-hashtag" href="#邮件通知模板"></a></h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">mailSubject</span>: <span class="string">&#x27;&#123;&#123;parent.nick&#125;&#125;，您在 &#123;&#123;site.name&#125;&#125; 上发表的评论,收到了来自 &#123;&#123;self.nick&#125;&#125; 的回复&#x27;</span>,</span><br><span class="line"><span class="attr">mailSubjectAdmin</span>: <span class="string">&#x27;&#123;&#123;site.name&#125;&#125; 上收到了来自 &#123;&#123;self.nick&#125;&#125; 的留言&#x27;</span>,</span><br><span class="line"><span class="attr">mailTemplate</span>: <span class="string">&#x27;&lt;head&gt;&lt;base target=&quot;_blank&quot;/&gt;&lt;style id=&quot;scrollbar&quot;type=&quot;text/css&quot;&gt;::-webkit-scrollbar&#123;width:0!important&#125;pre&#123;white-space:pre-wrap!important;word-wrap:break-word!important;*white-space:normal!important&#125;pre&#123;white-space:pre-wrap!important;word-wrap:break-word!important;*white-space:normal!important&#125;#letter img&#123;max-width:300px&#125;&lt;/style&gt;&lt;style id=&quot;from-wrapstyle&quot;type=&quot;text/css&quot;&gt;#form-wrap&#123;overflow:hidden;height:447px;position:relative;top:0px;transition:all 1s ease-in-out.3s;z-index:0&#125;&lt;/style&gt;&lt;style id=&quot;from-wraphoverstyle&quot;type=&quot;text/css&quot;&gt;#form-wrap:hover&#123;height:1300px;top:-200px&#125;&lt;/style&gt;&lt;/head&gt;&lt;body&gt;&lt;div style=&quot;width: 530px;margin: 20px auto 0;height: 1000px;&quot;&gt;&lt;div id=&quot;form-wrap&quot;&gt;&lt;img src=&quot;https://cdn.jsdelivr.net/gh/Akilarlxh/Valine-Admin@v1.0/source/img/before.png&quot;alt=&quot;before&quot;style=&quot;position: absolute;bottom: 126px;left: 0px;background-repeat: no-repeat;width: 530px;height: 317px;z-index:-100&quot;&gt;&lt;div style=&quot;position: relative;overflow: visible;height: 1500px;width: 500px;margin: 0px auto;transition: all 1s ease-in-out .3s;padding-top:200px;&quot;&lt;form&gt;&lt;div style=&quot;background: white;width: 95%;max-width: 800px;margin: auto auto;border-radius: 5px;border: 1px solid;overflow: hidden;-webkit-box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.12);box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.18);&quot;&gt;&lt;img style=&quot;width:100%;overflow: hidden;&quot;src=&quot;https://area.sinaapp.com/bingImg&quot;/&gt;&lt;div style=&quot;padding: 5px 20px;&quot;&gt;&lt;br&gt;&lt;div&gt;&lt;h3 style=&quot;text-decoration: none; color: #8fbc8f;&quot;&gt;&#123;&#123;parent.nick&#125;&#125;，见信安：&lt;/h3&gt;&lt;/div&gt;&lt;br&gt;&lt;div id=&quot;letter&quot;style=&quot;overflow:auto;height:300px;width:100%;display:block;word-break: break-all;word-wrap: break-word;&quot;&gt;&lt;p style=&quot;display: inline-block;&quot;&gt;您在&lt;a style=&quot;text-decoration: none;color: #8fbc8f&quot;target=&quot;_blank&quot;href=&quot;&#123;&#123;site.postUrl&#125;&#125; display: inline-block;&quot;&gt;&#123;&#123;site.name&#125;&#125;&lt;/a&gt;上发表的评论:&lt;/p&gt;&lt;div style=&quot;border-bottom: #ddd 1px solid;border-left: #ddd 1px solid;padding-bottom: 20px;background-color: #eee;margin: 15px 0px;padding-left: 20px;padding-right: 20px;border-top: #ddd 1px solid;border-right: #ddd 1px solid;padding-top: 20px;font-family: &quot;Arial&quot;, &quot;Microsoft YaHei&quot; , &quot;黑体&quot; , &quot;宋体&quot; , sans-serif;&quot;&gt;&#123;&#123;parent.comment | safe&#125;&#125;&lt;/div&gt;&lt;p&gt;收到了来自&#123;&#123;self.nick&#125;&#125;的回复：&lt;/p&gt;&lt;div style=&quot;border-bottom: #ddd 1px solid;border-left: #ddd 1px solid;padding-bottom: 20px;background-color: #eee;margin: 15px 0px;padding-left: 20px;padding-right: 20px;border-top: #ddd 1px solid;border-right: #ddd 1px solid;padding-top: 20px;font-family: &quot;Arial&quot;, &quot;Microsoft YaHei&quot; , &quot;黑体&quot; , &quot;宋体&quot; , sans-serif;&quot;&gt;&#123;&#123;self.comment | safe&#125;&#125;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;&lt;div style=&quot;text-align: center;margin-top: 40px;&quot;&gt;&lt;img src=&quot;https://ae01.alicdn.com/kf/U0968ee80fd5c4f05a02bdda9709b041eE.png&quot;alt=&quot;hr&quot;style=&quot;width:100%; margin:5px auto 5px auto; display: block;&quot;/&gt;&lt;a style=&quot;text-transform: uppercase;text-decoration: none;font-size: 14px;border: 2px solid #ace0f9;color: #FFFFFF;padding: 10px;display: inline-block;margin: 10px auto 0;background-color: #8fbc8f;&quot;target=&quot;_blank&quot;href=&quot;&#123;&#123;site.postUrl&#125;&#125;&quot;&gt;&#123;&#123;site.name&#125;&#125;｜请您签收~&lt;/a&gt;&lt;/div&gt;&lt;p style=&quot;font-size: 12px;text-align: center;color: #999;&quot;&gt;自动书记人偶竭诚为您服务！&lt;br&gt;©2020 - 2021 &lt;a style=&quot;text-decoration:none; color:#8fbc8f&quot;href=&quot;&#123;&#123;site.url&#125;&#125;&quot;&gt;&#123;&#123;site.name&#125;&#125;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/form&gt;&lt;/div&gt;&lt;img src=&quot;https://cdn.jsdelivr.net/gh/Akilarlxh/Valine-Admin@v1.0/source/img/after.png&quot;alt=&quot;after&quot;style=&quot;      position: absolute;bottom: -2px;left: 0;background-repeat: no-repeat;width: 530px;height: 259px;z-index:100&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/body&gt;&#x27;</span>,</span><br><span class="line"><span class="attr">mailTemplateAdmin</span>: <span class="string">&#x27;&lt;head&gt;&lt;base target=&quot;_blank&quot;/&gt;&lt;style id=&quot;scrollbar&quot;type=&quot;text/css&quot;&gt;::-webkit-scrollbar&#123;width:0!important&#125;pre&#123;white-space:pre-wrap!important;word-wrap:break-word!important;*white-space:normal!important&#125;#letter img&#123;max-width:300px&#125;&lt;/style&gt;&lt;style id=&quot;from-wrapstyle&quot;type=&quot;text/css&quot;&gt;#form-wrap&#123;overflow:hidden;height:447px;position:relative;top:0px;transition:all 1s ease-in-out.3s;z-index:0&#125;&lt;/style&gt;&lt;style id=&quot;from-wraphoverstyle&quot;type=&quot;text/css&quot;&gt;#form-wrap:hover&#123;height:1300px;top:-200px&#125;&lt;/style&gt;&lt;/head&gt;&lt;body&gt;&lt;div style=&quot;width: 530px;margin: 20px auto 0;height: 1000px;&quot;&gt;&lt;div id=&quot;form-wrap&quot;&gt;&lt;img src=&quot;https://cdn.jsdelivr.net/gh/Akilarlxh/Valine-Admin@v1.0/source/img/before.png&quot;alt=&quot;before&quot;style=&quot;position: absolute;bottom: 126px;left: 0px;background-repeat: no-repeat;width: 530px;height: 317px;z-index:-100&quot;&gt;&lt;div style=&quot;position: relative;overflow: visible;height: 1500px;width: 500px;margin: 0px auto;transition: all 1s ease-in-out .3s;padding-top:200px;&quot;&gt;&lt;form&gt;&lt;div style=&quot;background: white;width: 95%;max-width: 800px;margin: auto auto;border-radius: 5px;border: 1px solid;overflow: hidden;-webkit-box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.12);box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.18);&quot;&gt;&lt;img style=&quot;width:100%;overflow: hidden;&quot;src=&quot;https://area.sinaapp.com/bingImg&quot;/&gt;&lt;div style=&quot;padding: 5px 20px;&quot;&gt;&lt;br&gt;&lt;div&gt;&lt;h3 style=&quot;text-decoration: none; color: #8fbc8f;&quot;&gt;来自&#123;&#123;self.nick&#125;&#125;的留言:&lt;/h3&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;div id=&quot;letter&quot;style=&quot;overflow:auto;height:300px;width:100%;display:block;word-break: break-all;word-wrap: break-word;&quot;&gt;&lt;div style=&quot;border-bottom: #ddd 1px solid;border-left: #ddd 1px solid;padding-bottom: 20px;background-color: #eee;margin: 15px 0px;padding-left: 20px;padding-right: 20px;border-top: #ddd 1px solid;border-right: #ddd 1px solid;padding-top: 20px;font-family: &quot;Arial&quot;, &quot;Microsoft YaHei&quot; , &quot;黑体&quot; , &quot;宋体&quot; , sans-serif;&quot;&gt;&#123;&#123;self.comment | safe&#125;&#125;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;margin-top: 40px;&quot;&gt;&lt;img src=&quot;https://ae01.alicdn.com/kf/U0968ee80fd5c4f05a02bdda9709b041eE.png&quot;alt=&quot;hr&quot;style=&quot;width:100%; margin:5px auto 5px auto; display: block;&quot;/&gt;&lt;a style=&quot;text-transform: uppercase;text-decoration: none;font-size: 14px;border: 2px solid #ace0f9;color: #FFFFFF;padding: 10px;display: inline-block;margin: 10px auto 0;background-color: #8fbc8f;&quot;target=&quot;_blank&quot;href=&quot;&#123;&#123;site.postUrl&#125;&#125;&quot;&gt;&#123;&#123;site.name&#125;&#125;｜请您过目~&lt;/a&gt;&lt;/div&gt;&lt;p style=&quot;font-size: 12px;text-align: center;color: #999;&quot;&gt;©2020 - 2021 &lt;a style=&quot;text-decoration:none; color:#8fbc8f&quot;href=&quot;&#123;&#123;site.url&#125;&#125;&quot;&gt;&#123;&#123;site.name&#125;&#125;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/form&gt;&lt;/div&gt;&lt;img src=&quot;https://cdn.jsdelivr.net/gh/Akilarlxh/Valine-Admin@v1.0/source/img/after.png&quot;alt=&quot;after&quot;style=&quot;      position: absolute;bottom: -2px;left: 0;background-repeat: no-repeat;width: 530px;height: 259px;z-index:100&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/body&gt;&#x27;</span></span><br></pre></td></tr></table></figure><h3 id="下载">下载<a class="fa-solid fa-hashtag" href="#下载"></a></h3><p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://file.nmb.show/down.php/4ca88b8fe0729c213cd3a425f87d2f51.rar">邮件通知模板下载</a>（包含 Waline/Valine/Twikoo），您可以下载后根据官方文档提及的变量自行修改<code>index.js</code>相关内容，以上代码仅作参考，对于本文未涉及到的其他内容，请自行查看官方文档，如有错误，欢迎指正，谢谢！</p></article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta"><i class="fas fa-circle-user fa-fw"></i>文章作者: </span><span class="post-copyright-info"><a href="https://blog.ccknbc.cc/">CC康纳百川</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta"><i class="fas fa-square-arrow-up-right fa-fw"></i>文章链接: </span><span class="post-copyright-info"><a href="https://blog.ccknbc.cc/posts/waline-comments-system-deployment-logs/">https://blog.ccknbc.cc/posts/waline-comments-system-deployment-logs/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta"><i class="fas fa-circle-exclamation fa-fw"></i>版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a target="_blank" rel="noopener external nofollow noreferrer" href="https://creativecommons.org/licenses/by-nc-sa/4.0/"><i style="color:#8fbc8f" class="fa-brands fa-creative-commons"></i> <i style="color:#8fbc8f" class="fa-brands fa-creative-commons-by"></i> <i style="color:#8fbc8f" class="fa-brands fa-creative-commons-nc"></i> <i style="color:#8fbc8f" class="fa-brands fa-creative-commons-sa"></i> CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://blog.ccknbc.cc">CC的部落格</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/%E5%B7%A5%E5%85%B7/">工具</a></div><div class="post_share"><div class="social-share" data-image="https://pic1.afdiancdn.com/user/8a7f563c2e3811ecab5852540025c377/common/edd977e4a8569283e89ac7426b67dfc3_w1920_h1080_s366.jpg" data-sites="wechat,weibo,qq,facebook,twitter"></div><link rel="stylesheet" href="https://jsd.cdn.zzko.cn/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload='this.media="all"'><script src="https://jsd.cdn.zzko.cn/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><div class="post-reward"><div class="reward-button"><i class="fas fa-qrcode"></i>赞赏</div><div class="reward-main"><ul class="reward-all"><li class="reward-item"><a href="https://www.rocschool.com/tool/qr/qr/id/51.html" rel="external nofollow noreferrer" target="_blank"><img class="post-qr-code-img" src= "" data-lazy-src="https://jsd.cdn.zzko.cn/gh/ccknbc-backup/cdn/logo/qr.png" alt="三合一"></a><div class="post-qr-code-desc">三合一</div></li><li class="reward-item"><a href="https://afdian.net/@ccknbc" rel="external nofollow noreferrer" target="_blank"><img class="post-qr-code-img" src= "" data-lazy-src="https://jsd.cdn.zzko.cn/gh/ccknbc-backup/cdn/logo/afdian.png" alt="爱发电"></a><div class="post-qr-code-desc">爱发电</div></li></ul></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/posts/a-simple-but-not-simple-m3u8-download-tool/" title="一款简洁却不简单的 m3u8 下载工具"><img class="cover" src= "" data-lazy-src="https://pic1.afdiancdn.com/user/8a7f563c2e3811ecab5852540025c377/common/1f5858acdba3b4bf21f2ea3c1ecad61a_w2240_h1260_s485.jpg" onerror='onerror=null,src="https://jsd.cdn.zzko.cn/npm/hexo-theme-anzhiyu/source/img/friend_404.gif"' alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">一款简洁却不简单的 m3u8 下载工具</div></div></a></div><div class="next-post pull-right"><a href="/posts/github-automatically-merges-pull-requests-notes/" title="GitHub 自动合并 PR 笔记"><img class="cover" src= "" data-lazy-src="https://pic1.afdiancdn.com/user/8a7f563c2e3811ecab5852540025c377/common/75d33bcc96205123aa3a40aae776d793_w2560_h1440_s704.jpg" onerror='onerror=null,src="https://jsd.cdn.zzko.cn/npm/hexo-theme-anzhiyu/source/img/friend_404.gif"' alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">GitHub 自动合并 PR 笔记</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><div><a href="/posts/hexo-webpushr-notification/" title="Hexo浏览器定向推送文章更新"><img class="cover" src= "" data-lazy-src="https://pic1.afdiancdn.com/user/8a7f563c2e3811ecab5852540025c377/common/d2a947d48815ed24936a919873b97841_w1366_h768_s31.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-10-05</div><div class="title">Hexo浏览器定向推送文章更新</div></div></a></div><div><a href="/posts/the-real-addthis/" title="你以为 AddThis 只是个分享工具吗？"><img class="cover" src= "" data-lazy-src="https://pic1.afdiancdn.com/user/8a7f563c2e3811ecab5852540025c377/common/bbf0970587cfd0f4a654efda9c375844_w1920_h1080_s216.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-05-15</div><div class="title">你以为 AddThis 只是个分享工具吗？</div></div></a></div><div><a href="/posts/hexo-butterfly-algolia/" title="Hexo Butterfly Algolia 搜索的使用"><img class="cover" src= "" data-lazy-src="https://pic1.afdiancdn.com/user/8a7f563c2e3811ecab5852540025c377/common/c9dcd19b9621a425f914ffb64cf2f8c1_w1920_h1080_s281.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-05-11</div><div class="title">Hexo Butterfly Algolia 搜索的使用</div></div></a></div><div><a href="/posts/yuque-to-hexo/" title="语雀文章同步至Hexo笔记"><img class="cover" src= "" data-lazy-src="https://pic1.afdiancdn.com/user/8a7f563c2e3811ecab5852540025c377/common/721e476cb2661152b9c43621c94e3ed7_w1366_h768_s86.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-10-04</div><div class="title">语雀文章同步至Hexo笔记</div></div></a></div><div><a href="/posts/2fa-last-security-line/" title="两步验证 最后一道安全防线"><img class="cover" src= "" data-lazy-src="https://pic1.afdiancdn.com/user/8a7f563c2e3811ecab5852540025c377/common/0d0f43b526a6944a65566a2fd7aa9939_w1920_h1080_s214.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-11-21</div><div class="title">两步验证 最后一道安全防线</div></div></a></div><div><a href="/posts/implementation-of-simple-browser-update-push/" title="简单浏览器更新推送的实现"><img class="cover" src= "" data-lazy-src="https://pic1.afdiancdn.com/user/8a7f563c2e3811ecab5852540025c377/common/42a535535c03bb6e4e10f2d2501b3e36_w2240_h1260_s2693.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-08-18</div><div class="title">简单浏览器更新推送的实现</div></div></a></div></div></div><hr class="custom-hr"><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div id="waline-wrap"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%89%B9%E6%80%A7"><span class="toc-number">1.</span> <span class="toc-text">特性</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Todo"><span class="toc-number">2.</span> <span class="toc-text">Todo</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Vercel-LeanCloud-%E9%83%A8%E7%BD%B2"><span class="toc-number">3.</span> <span class="toc-text">Vercel + LeanCloud 部署</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%85%8D%E7%BD%AE%E9%A1%B9"><span class="toc-number">3.1.</span> <span class="toc-text">配置项</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#CloudBase-%E4%BA%91%E5%BC%80%E5%8F%91%E9%83%A8%E7%BD%B2"><span class="toc-number">4.</span> <span class="toc-text">CloudBase 云开发部署</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%80%E9%94%AE%E9%83%A8%E7%BD%B2"><span class="toc-number">4.1.</span> <span class="toc-text">一键部署</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2"><span class="toc-number">4.2.</span> <span class="toc-text">手动部署</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%A6%82%E4%BD%95%E5%8D%87%E7%BA%A7"><span class="toc-number">5.</span> <span class="toc-text">如何升级</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#Vercel"><span class="toc-number">5.1.</span> <span class="toc-text">Vercel</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%89%8B%E5%8A%A8%E5%8D%87%E7%BA%A7"><span class="toc-number">5.1.1.</span> <span class="toc-text">手动升级</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E8%87%AA%E5%8A%A8%E5%8D%87%E7%BA%A7"><span class="toc-number">5.1.2.</span> <span class="toc-text">自动升级</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#CloudBase"><span class="toc-number">5.2.</span> <span class="toc-text">CloudBase</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%B8%80%E9%94%AE%E9%83%A8%E7%BD%B2-2"><span class="toc-number">5.2.1.</span> <span class="toc-text">一键部署</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%89%8B%E5%8A%A8%E9%83%A8%E7%BD%B2-2"><span class="toc-number">5.2.2.</span> <span class="toc-text">手动部署</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%89%8B%E5%8A%A8%E5%8D%87%E7%BA%A7-2"><span class="toc-number">5.2.2.1.</span> <span class="toc-text">手动升级</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E8%87%AA%E5%8A%A8%E5%8D%87%E7%BA%A7-2"><span class="toc-number">5.2.2.2.</span> <span class="toc-text">自动升级</span></a></li></ol></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%99%84%E5%BD%95"><span class="toc-number">6.</span> <span class="toc-text">附录</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%82%AE%E4%BB%B6%E9%80%9A%E7%9F%A5%E6%A8%A1%E6%9D%BF"><span class="toc-number">6.1.</span> <span class="toc-text">邮件通知模板</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%8B%E8%BD%BD"><span class="toc-number">6.2.</span> <span class="toc-text">下载</span></a></li></ol></li></ol></div></div></div></div></main><footer id="footer" style="background:linear-gradient(135deg,#fff1eb,#ace0f9)"><div id="footer-wrap"><div class="icp"><a target="_blank" rel="noopener external nofollow noreferrer" href="https://beian.miit.gov.cn"><img class="icp-icon" src= "" data-lazy-src="https://jsd.cdn.zzko.cn/gh/ccknbc-backup/cdn/logo/icp.png" alt="ICP"><span>鄂 ICP 备 2020019764 号</span></a></div><div class="gongan"><a target="_blank" rel="noopener external nofollow noreferrer" href="https://www.beian.gov.cn/portal/registerSystemInfo?recordcode=42088102000092"><img class="gongan-icon" src= "" data-lazy-src="https://jsd.cdn.zzko.cn/gh/ccknbc-backup/cdn/logo/gongan.png" alt="gongan"><span>鄂公网安备 42088102000092 号</span></a></div><div class="live"><span>本站已运行</span><span id="display_live"></span><span class="moe-text">CCKNBC All Rights Reserved.</span><script>function blog_live(){window.setTimeout(blog_live,1e3);var e=new Date("2020-06-04T00:00:00"),o=new Date,l=o.getFullYear(),o=o.getTime()-e.getTime(),e=864e5,t=365*e,i=Math.floor(o/t),t=Math.floor(o%t/e),e=Math.floor(o%e/60/60/1e3),a=Math.floor(o%36e5/60/1e3),o=Math.floor(o%6e4/1e3);display_live.innerHTML=" "+i+" 年 "+t+" 天 "+e+" 小时 "+a+" 分 "+o+" 秒<br>&copy; 2020 - "+l+" "}blog_live()</script></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><a class="edit-yuque" target="_blank" rel="noopener external nofollow noreferrer" href="https://www.yuque.com/ccknbc/blog/20/edit/" title="在语雀上以富文本格式编辑/预览 - Waline 评论系统部署日志"><i class="fa-solid fa-crow"></i></a><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fa-solid fa-arrows-alt-h"></i></button><button id="readmode" type="button" title="阅读模式"><i class="fa-solid fa-book-open"></i></button><button id="translateLink" type="button" title="简繁转换">繁</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fa-solid fa-adjust"></i></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="设置"><i class="fa-solid fa-cog"></i></button><button id="share-link" type="button" title="分享链接"><i class="fa-solid fa-share"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fa-solid fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fa-solid fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fa-solid fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://jsd.cdn.zzko.cn/npm/@fancyapps/ui/dist/fancybox/fancybox.umd.js"></script><script src="https://jsd.cdn.zzko.cn/npm/instant.page/instantpage.js" type="module"></script><script src="https://jsd.cdn.zzko.cn/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><script src="https://jsd.cdn.zzko.cn/npm/node-snackbar/dist/snackbar.min.js"></script><div class="js-pjax"><script>(()=>{var e=()=>{var e;const t=document.querySelectorAll("#article-container .mermaid-wrap");0!==t.length&&(e=()=>{{var e=t;window.loadMermaid=!0;const a="dark"===document.documentElement.getAttribute("data-theme")?"dark":"default";Array.from(e).forEach((e,t)=>{const n=e.firstElementChild;e="%%{init:{ 'theme':'"+a+"'}}%%\n"+n.textContent;const d=mermaid.render("mermaid-"+t,e);"string"==typeof d?(t=d,n.insertAdjacentHTML("afterend",t)):d.then(({svg:e})=>{n.insertAdjacentHTML("afterend",e)})})}},btf.addGlobalFn("themeChange",e,"mermaid"),window.loadMermaid?e():btf.getScript("https://jsd.cdn.zzko.cn/npm/mermaid/dist/mermaid.min.js").then(e))};btf.addGlobalFn("encrypt",e,"mermaid"),window.pjax?e():document.addEventListener("DOMContentLoaded",e)})()</script><script>(()=>{let n=window.walineFn||null;const t=e=>{const n=e(Object.assign({el:"#waline-wrap",serverURL:"https://waline.ccknbc.cc",pageview:!1,dark:'html[data-theme="dark"]',path:window.location.pathname,comment:!1,imageUploader:function(e){var n=new FormData,t=new Headers;return n.append("file",e),n.append("album_id","10"),n.append("permission","0"),t.append("Authorization","Bearer 24|o8Crl5y0oK3luyUs17fBxDtAcevk1iiLHVFMNjpA"),t.append("Accept","application/json"),fetch("https://wmimg.com/api/v1/upload",{method:"POST",headers:t,body:n}).then(e=>e.json()).then(e=>e.data.links.url)}},{pageSize:10,meta:["nick","mail","link"],requiredMeta:["nick","mail"],login:"force",copyright:!0,search:!0,turnstileKey:"0x4AAAAAAAECBl27OB5SZrQT",locale:{admin:"博主",sofa:"这里冷冷清清的，快来留下脚印吧！",placeholder:"根据《互联网跟帖评论服务管理规定》，将展示您的归属地，并开启强制注册登录后才允许评论\n社交登录现已支持【QQ Weibo GitHub X Facebook】等平台，登录后可点击头像更改个人主页地址，方便CC串门\n在评论框粘贴图片，自动上传至图床，请不要将评论区作为您的图床，更不要上传违法图片，谢谢合作",reactionTitle:"就现在，表明你的态度！",reaction0:"鼓励",reaction1:"菜狗",reaction2:"正确",reaction3:"错误",reaction4:"思考",reaction5:"无聊",level0:"买菜",level1:"切菜",level2:"炒菜",level3:"煲汤",level4:"煮面",level5:"上桌",level6:"开吃"},emoji:["https://jsd.cdn.zzko.cn/npm/sticker-heo/Sticker-100/"],reaction:["https://jsd.cdn.zzko.cn/npm/sticker-heo/Sticker-100/鼓掌.png","https://jsd.cdn.zzko.cn/npm/sticker-heo/Sticker-100/菜狗.png","https://jsd.cdn.zzko.cn/npm/sticker-heo/Sticker-100/正确.png","https://jsd.cdn.zzko.cn/npm/sticker-heo/Sticker-100/错误.png","https://jsd.cdn.zzko.cn/npm/sticker-heo/Sticker-100/思考.png","https://jsd.cdn.zzko.cn/npm/sticker-heo/Sticker-100/睡觉.png"]}));btf.addGlobalFn("pjax",()=>{n.destroy()},"destroyWaline")};var e=()=>{n?t(n):(btf.getCSS("https://jsd.cdn.zzko.cn/npm/@waline/client/dist/waline.css"),btf.getCSS("https://jsd.cdn.zzko.cn/npm/@waline/client/dist/waline-meta.css").then(()=>import("https://jsd.cdn.zzko.cn/npm/@waline/client/dist/waline.js")).then(({init:e})=>{n=e||Waline.init,t(n),window.walineFn=n}))};btf.loadComment(document.getElementById("waline-wrap"),e)})()</script></div><script>window.addEventListener("load",()=>{const t=e=>e=""!==e&&150<(e=(e=(e=(e=e.replace(/<img.*?src="(.*?)"?[^\>]+>/gi,"[图片]")).replace(/<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi,"[链接]")).replace(/<pre><code>.*?<\/pre>/gi,"[代码]")).replace(/<[^>]+>/g,"")).length?e.substring(0,150)+"...":e,a=t=>{let a="";if(t.length)for(let e=0;e<t.length;e++)a=(a+="<div class='aside-list-item'>")+`<div class='content'>
        <a class='comment' href='${t[e].url}' title='${t[e].content}'>${t[e].content}</a>
        <div class='name'><span>${t[e].nick} / </span><time datetime="${t[e].date}">${btf.diffDate(t[e].date,!0)}</time></div>
        </div></div>`;else a+="没有评论";var e=document.querySelector("#card-newest-comments .aside-list");e&&(e.innerHTML=a),window.lazyLoadInstance&&window.lazyLoadInstance.update(),window.pjax&&window.pjax.refresh(e)};var e=()=>{var e;document.querySelector("#card-newest-comments .aside-list")&&((e=btf.saveToLocal.get("waline-newest-comments"))?a(JSON.parse(e)):(async()=>{try{var e=(await(await fetch("https://waline.ccknbc.cc/api/comment?type=recent&count=3",{method:"GET"})).json()).data.map(e=>({content:t(e.comment),avatar:e.avatar,nick:e.nick,url:e.url+"#post-comment",date:e.time||e.insertedAt}));btf.saveToLocal.set("waline-newest-comments",JSON.stringify(e),10/1440),a(e)}catch(e){console.error(e),document.querySelector("#card-newest-comments .aside-list").textContent="无法获取评论，请确认相关配置是否正确"}})())};e(),btf.addGlobalFn("pjaxComplete",e,"waline_newestComment")})</script><script defer src="/js/custom.js"></script><script src="https://jsd.cdn.zzko.cn/npm/pjax/pjax.min.js"></script><script>let pjaxSelectors=["head > title","#config-diff","#body-wrap","#rightside-config-hide","#rightside-config-show",".js-pjax"];var pjax=new Pjax({elements:'a:not([target="_blank"])',selectors:pjaxSelectors,cacheBust:!1,analytics:!1,scrollRestoration:!1});const triggerPjaxFn=e=>{e&&Object.values(e).forEach(e=>{e()})};document.addEventListener("pjax:send",function(){btf.removeGlobalFnEvent("pjax"),btf.removeGlobalFnEvent("themeChange");var e=document.body.classList;e.contains("read-mode")&&e.remove("read-mode"),triggerPjaxFn(window.globalFn.pjaxSend)}),document.addEventListener("pjax:complete",()=>{document.querySelectorAll("script[data-pjax]").forEach(e=>{const t=document.createElement("script");var a=e.text||e.textContent||e.innerHTML||"";Array.from(e.attributes).forEach(e=>t.setAttribute(e.name,e.value)),t.appendChild(document.createTextNode(a)),e.parentNode.replaceChild(t,e)}),triggerPjaxFn(window.globalFn.pjaxComplete)}),document.addEventListener("pjax:error",e=>{404===e.request.status&&pjax.loadUrl("/404")})</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><div class="docsearch-wrap"><div id="docsearch" style="display:none"></div><link rel="stylesheet" href="https://jsd.cdn.zzko.cn/npm/@docsearch/css/dist/style.css"><script src="https://jsd.cdn.zzko.cn/npm/@docsearch/js/dist/umd/index.js"></script><script>(()=>{docsearch(Object.assign({appId:"97MUPN4DMC",apiKey:"a003a39f337f5186ec11f5f92bae62b3",indexName:"ccknbc",container:"#docsearch"},{placeholder:"Ctrl/⌘ + K 唤醒搜索服务",maxResultsPerGroup:7,translations:{button:{buttonText:"搜索",buttonAriaLabel:"搜索"},modal:{searchBox:{resetButtonTitle:"清空",resetButtonAriaLabel:"清空",cancelButtonText:"取消",cancelButtonAriaLabel:"取消"},startScreen:{recentSearchesTitle:"最近搜索历史",noRecentSearchesText:"搜索历史为空",saveRecentSearchButtonTitle:"保存搜索记录",removeRecentSearchButtonTitle:"清除搜索记录",favoriteSearchesTitle:"收藏夹",removeFavoriteSearchButtonTitle:"移出收藏夹"},errorScreen:{titleText:"未能获取搜索结果",helpText:"您可能需要检查您的网络连接"},footer:{selectText:"选择",selectKeyAriaLabel:"回车键",navigateText:"切换",navigateUpKeyAriaLabel:"方向键上",navigateDownKeyAriaLabel:"方向键下",closeText:"关闭",closeKeyAriaLabel:"退出键",searchByText:"搜索服务提供: DocSearch by"},noResultsScreen:{noResultsText:"未搜索到相关内容",suggestedQueryText:"您可尝试搜索",reportMissingResultsText:"确认搜索结果是正确的？",reportMissingResultsLinkText:"反馈给Algolia"}}}}));const e=()=>{document.querySelector(".DocSearch-Button").click()};var t=()=>{btf.addEventListenerPjax(document.querySelector("#search-button > .search"),"click",e)};t(),window.addEventListener("pjax:complete",t)})()</script></div></div><script>const copyright_enable=!0</script><script src="https://jsd.cdn.zzko.cn/npm/turndown/dist/turndown.min.js"></script><script src="https://jsd.cdn.zzko.cn/gh/ccknbc-forked/hexo-butterfly-copymarkdown/lib/copyMarkdown.min.js"></script><script src="https://jsd.cdn.zzko.cn/gh/ccknbc-forked/hexo-butterfly-copymarkdown/lib/reprint.min.js"></script><script>(function (w, d, s, id) {
        if (typeof (w.webpushr) !== 'undefined') return;
        w.webpushr = w.webpushr || function () { (w.webpushr.q = w.webpushr.q || []).push(arguments) };
        var js, fjs = d.getElementsByTagName(s)[0];
        js = d.createElement(s);
        js.id = id;
        js.async = 1;
        js.src = "https://cdn.webpushr.com/app.min.js";
        fjs.parentNode.appendChild(js);
        }(window, document, 'script', 'webpushr-jssdk'));

        webpushr('setup', {
        'key': 'BB9Y-w9p3u0CKA7UP9nupB6I-_NqE2MuODmKJjyC4W2YflX06Ff_hEhrNJfonrut5l6gCa28gC83q2OII7Qv-oA',
        'sw': 'none'
        });
        </script></body></html>